home *** CD-ROM | disk | FTP | other *** search
/ Micromanía: 150 Juegos 2010 / 150Juegos_16.iso / Shareware / Shape Smash / shape-smash.swf / scripts / Code / LIB / SOUND / _bu111.as next >
Encoding:
Text File  |  2010-05-14  |  5.6 KB  |  207 lines

  1. package Code.LIB.SOUND
  2. {
  3.    import Code.LIB.COMPONENTS._gy596;
  4.    import Code.LIB._cg33;
  5.    import Code.OPTIONS._gs337;
  6.    import flash.events.MouseEvent;
  7.    import flash.media.Sound;
  8.    import flash.media.SoundChannel;
  9.    import flash.media.SoundMixer;
  10.    import flash.media.SoundTransform;
  11.    import flash.utils.*;
  12.    
  13.    public class _bu111
  14.    {
  15.       public static var iMusic:_gy596;
  16.       
  17.       private static var savedSoundsV:Number;
  18.       
  19.       public static var iSound:_gy596;
  20.       
  21.       private static var iList:_gw228;
  22.       
  23.       private static var iMusikVolume:Number;
  24.       
  25.       private static var savedMusicV:Number;
  26.       
  27.       private static var iSounds:Array = new Array();
  28.       
  29.       private static var iSTransform:SoundTransform = new SoundTransform();
  30.       
  31.       private static var iMTransform:SoundTransform = new SoundTransform();
  32.       
  33.       private static var iMChannel:SoundChannel = new SoundChannel();
  34.       
  35.       private static var iSChannel:SoundChannel = new SoundChannel();
  36.       
  37.       private static var iSoundVolume:Number = 1;
  38.       
  39.       public static var iMusPlaying:Boolean = false;
  40.       
  41.       public function _bu111()
  42.       {
  43.          super();
  44.       }
  45.       
  46.       public static function set _yt336(param1:Number) : void
  47.       {
  48.          iMusikVolume = param1;
  49.          iMTransform.volume = iMusikVolume;
  50.          iMChannel.soundTransform = iMTransform;
  51.          if(iMusikVolume == 0)
  52.          {
  53.             iMusic.State = _gy596.stOff;
  54.          }
  55.          else
  56.          {
  57.             iMusic.State = _gy596.stOnn;
  58.          }
  59.          if(_cg33._ss555)
  60.          {
  61.             _cg33._ss555[1].prMVolume = param1;
  62.          }
  63.       }
  64.       
  65.       private static function _hd374(param1:String) : Sound
  66.       {
  67.          var _loc2_:Array = null;
  68.          for each(_loc2_ in iSounds)
  69.          {
  70.             if(_loc2_[0] == param1)
  71.             {
  72.                return Sound(_loc2_[1]);
  73.             }
  74.          }
  75.          return null;
  76.       }
  77.       
  78.       public static function get _uk57() : Number
  79.       {
  80.          return iSoundVolume;
  81.       }
  82.       
  83.       public static function get _yt336() : Number
  84.       {
  85.          return iMusikVolume;
  86.       }
  87.       
  88.       public static function _wu209(param1:String, param2:Boolean = false) : void
  89.       {
  90.          var _loc3_:Sound = null;
  91.          iSTransform.volume = iSoundVolume;
  92.          iMTransform.volume = iMusikVolume;
  93.          _loc3_ = _hd374(param1);
  94.          if(!_loc3_)
  95.          {
  96.             return;
  97.          }
  98.          if(param2)
  99.          {
  100.             if(iMusPlaying)
  101.             {
  102.                return;
  103.             }
  104.             iMusPlaying = true;
  105.             iMChannel.stop();
  106.             iMChannel = _loc3_.play(0,999,iMTransform);
  107.          }
  108.          else
  109.          {
  110.             iSChannel = _loc3_.play(0,0,iSTransform);
  111.          }
  112.       }
  113.       
  114.       public static function _pp317(param1:Array) : void
  115.       {
  116.          var _loc2_:Array = null;
  117.          var _loc3_:Array = null;
  118.          var _loc4_:Sound = null;
  119.          iSound = new _gy596(_gs337.TSpeakerOnn,_gs337.TSpeakerOff);
  120.          iSound._vq458 = 604;
  121.          iMusic = new _gy596(_gs337.TMusicOnn,_gs337.TMusicOff);
  122.          iMusic._vq458 = 574;
  123.          iSound._vg471 = 12;
  124.          iMusic._vg471 = 13;
  125.          iSound.addEventListener(MouseEvent.MOUSE_DOWN,_ld216);
  126.          iMusic.addEventListener(MouseEvent.MOUSE_DOWN,_ld216);
  127.          iSTransform.volume = iSoundVolume;
  128.          iMTransform.volume = iMusikVolume;
  129.          _loc2_ = iSounds;
  130.          for each(_loc3_ in param1)
  131.          {
  132.             _loc4_ = new _loc3_[1]() as Sound;
  133.             iSounds.push([_loc3_[0],_loc4_]);
  134.          }
  135.          _bu111.iList = new _gw228(iSTransform);
  136.       }
  137.       
  138.       public static function _um807(param1:String) : void
  139.       {
  140.          _bu111.iList.add(_hd374(param1));
  141.       }
  142.       
  143.       public static function set _uk57(param1:Number) : void
  144.       {
  145.          iSoundVolume = param1;
  146.          if(_cg33._ss555)
  147.          {
  148.             _cg33._ss555[1].prSVolume = param1;
  149.          }
  150.          if(iSoundVolume == 0)
  151.          {
  152.             iSound.State = _gy596.stOff;
  153.          }
  154.          else
  155.          {
  156.             iSound.State = _gy596.stOnn;
  157.          }
  158.       }
  159.       
  160.       public static function _ld216(param1:MouseEvent) : void
  161.       {
  162.          switch(param1.target)
  163.          {
  164.             case iMusic.iButton._en365:
  165.                if(iMusic.State == _gy596.stOnn)
  166.                {
  167.                   savedMusicV = _yt336;
  168.                   _yt336 = 0;
  169.                   iMusic.State = _gy596.stOff;
  170.                }
  171.                else
  172.                {
  173.                   _yt336 = !!savedMusicV ? savedMusicV : 0.7;
  174.                   iMusic.State = _gy596.stOnn;
  175.                }
  176.                _cg33._gk638();
  177.                break;
  178.             case iSound.iButton._en365:
  179.                if(iSound.State == _gy596.stOnn)
  180.                {
  181.                   savedSoundsV = _uk57;
  182.                   _uk57 = 0;
  183.                   iSound.State = _gy596.stOff;
  184.                }
  185.                else
  186.                {
  187.                   _uk57 = !!savedSoundsV ? savedSoundsV : 0.7;
  188.                   iSound.State = _gy596.stOnn;
  189.                }
  190.                _cg33._gk638();
  191.          }
  192.       }
  193.       
  194.       public static function _gx822() : void
  195.       {
  196.          iMusPlaying = false;
  197.          SoundMixer.stopAll();
  198.       }
  199.       
  200.       public static function _nm154() : void
  201.       {
  202.          iSChannel.stop();
  203.       }
  204.    }
  205. }
  206.  
  207.